from bottle import route, run, template, debug, static_file, response
import json
import time
import os

@route('/')
def index():
    return static_file('index.html', root=r'D:\Development\forall\dev')
    
@route('/<filename:path>')
def myfile(filename="index.html"):
    return static_file(filename, root=r'D:\Development\forall\dev')
    
a = '''
@route('/resource:resource#[0-9]+#')
def show_resource(resource):
    return {'task':'This item number does not exist!'}

@route('/single')
def returnsingle():
    return { "id": 1, "name": "Test Item 1" }
'''

@route('/single')
def returnsingle():
    response.content_type = 'application/json'
    return json.dumps({ "id": 1, "name": "Test Item 1" })
    
debug(True)
run(reloader=True, host='localhost', port=8080)